package com.doge;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputMultiplexer;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Stage;

import java.util.ArrayList;

public class Main extends Game implements com.badlogic.gdx.ApplicationListener
{
	
	public Settings settings;
	public Textures textures;

	public Stage menuStage;				
	public Stage characterStage;	
	public FightScreen fightStage;
	public Overworld overworld;
	public SkillupScreen skillupScreen;
	
	public Hud   hud;

	public Menu menu;
	
	public Player p;

	//ArrayList<Character> chracters = new ArrayList();

	@Override
	public void create() {
		//Load textures
		//Gdx.files.absolute("data/grass.png");
		textures = new Textures(this);
		settings = new Settings();
		p = new Player(this,null,null);
		characterStage = new Stage();
		menuStage = new Stage();
		overworld = new Overworld(this);
		fightStage = new FightScreen(this, p);
		skillupScreen = new SkillupScreen(this);
		menu = new Menu(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(),true, new SpriteBatch(),this);
		
		Gdx.input.setInputProcessor(overworld);
		this.setScreen(menu);

		//Gdx.input.setInputProcessor(fightStage);
		//fightStage.setCharacters( new MovingFireball(this, Textures.movingFireball, null ));
		//this.setScreen(fightStage);
		
		//Gdx.input.setInputProcessor(skillupScreen);
		//this.setScreen(skillupScreen);

		
		//this.setScreen(menu);
		
	}

	public void dispose() {
		menuStage.dispose();
	}
	
//	@Override
//	public void render() {
//		System.out.println(Gdx.graphics.getFramesPerSecond());
//		//		 Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
//		//	        stage.act(Gdx.graphics.getDeltaTime());
//		//	        characterStage.act(Gdx.graphics.getDeltaTime());
//		//	        characterStage.draw();
//		//	        stage.draw();            
//		//	        hud.act(Gdx.graphics.getDeltaTime());
//		//	        hud.draw();
//	}

	public void resize (int width, int height) {
		menuStage.setViewport(width, height, true);
	}

	public void pause() {}
	public void resume() {}
	public void show() {}
	public void hide() {}

}
